package com.ruibang.glass.quality.controller;

import com.ruibang.glass.quality.domain.req.EverydayDiscardDefectReq;
import com.ruibang.glass.quality.service.EverydayBandDefectService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-09-18  16:07
 * @Description: TODO:待投判废缺陷数据
 * @Version: 1.0
 */

@RestController
@RequestMapping("/api/band/defect")
@Api(value = "待投判废缺陷控制器", tags = {"待投判废缺陷控制器"})
public class EverydayBandDefectController {

    @Autowired
    private EverydayBandDefectService everydayBandDefectService;

    @PostMapping("/queryPageEveryHourColdDirect")
    @ApiOperation(value = "查询每日待投判废缺陷数据（分页）", notes = "查询每日待投判废缺陷数据（分页）")
    public ResultBody queryPageEveryHourColdDirect(@RequestBody @Valid EverydayDiscardDefectReq everydayDiscardDefectReq) {
        return everydayBandDefectService.queryPageEveryHourColdDirect(everydayDiscardDefectReq);
    }

    @PostMapping("/queryEverydayBandDefect")
    @ApiOperation(value = "查询每日待投判废缺陷数据(曲线图、柱状图)", notes = "查询每日待投判废缺陷数据（曲线图、柱状图）")
    public ResultBody everydayBandDefectService(@RequestBody @Valid EverydayDiscardDefectReq everydayDiscardDefectReq) {
        return everydayBandDefectService.queryEverydayBandDefect(everydayDiscardDefectReq);
    }

}
